<template>
  <component :is="currentLayout">
    <router-view />
  </component>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import MainLayout from '@/views/layout/MainLayout.vue';
import EmptyLayout from '@/views/layout/EmptyLayout.vue';

const route = useRoute();

// 根据路由元信息决定使用哪种布局
const currentLayout = computed(() => {
  return route.meta.layout === 'empty' ? EmptyLayout : MainLayout;
});
</script>